package controllers

import (
	"github.com/3xxx/engineercms/models"
	"github.com/astaxie/beego"
)

// base controller
type BaseController struct {
	beego.Controller
}

// ServeJSON sends a json response with encoding charset.
func (this *BaseController) ReturnJSON(code int, msg string, data interface{}) {
	this.Data["json"] = &models.JsonResult{Code: code, Msg: msg, Data: data}
	this.ServeJSON()
}
